package api

import (
	"coze_for_sdk/controller/chat"
	"coze_for_sdk/controller/conversation"
	"coze_for_sdk/middleware"

	"github.com/gin-gonic/gin"
)

func AuthRoutes(r *gin.Engine) {

	//api 接口
	authRouter := r.Group("/api")
	{
		authRouter.Use(middleware.CorsMiddleware())

		v1 := authRouter.Group("/v1")
		{
			v1.Use(middleware.AuthMiddleware())

			// 会话
			conversationGroup := v1.Group("/conversation")
			{
				conversationGroup.GET("create", conversation.Create)
				conversationGroup.GET("list", conversation.List)
				conversationGroup.POST("update", conversation.Update)
				conversationGroup.GET("delete", conversation.Delete)
			}

			chatGroup := v1.Group("/chat")
			{
				chatGroup.POST("create", chat.Create)
				chatGroup.GET("cancel", chat.Cancel)
				chatGroup.GET("list", chat.List)
			}
		}
	}
}
